import 'package:dmz/base/pageWidget/base_stateful_widget.dart';
import 'package:dmz/base/widget/load_state_widget.dart';
import 'package:dmz/business/home/controller/map_saver_controller.dart';
import 'package:dmz/business/home/widgets/map_widgets.dart';
import 'package:dmz/tools/map/map_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class MapServePointPage extends BaseStatefulWidget<MapServePointController> {
  const MapServePointPage({super.key});

  @override
  String titleString() => '服务网点'.tr;

  @override
  Widget buildContent(BuildContext context) {
    return controller.initLatLng == null
        ? createEmptyWidget(controller)
        : Stack(alignment: Alignment.bottomCenter, children: [
            EMIGDMapWidget(
              latLng: controller.initLatLng,
              initMarkerMap: controller.markerMap,
              onMapCreated: (controllered) =>
                  controller.mapController = controllered,
            ),
            if (!controller.showAppSelect)
              MapWidgets.servePointWidget(
                  controller.selectPoint!, controller.seleMapApp)
          ]);
  }
}
